﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace IFramework
{
    public interface IFSMState 
    {
        //FSMStateType StateType { get; }
        //List<StateTransition> ConditionTransitions { get; set; }
        //StateTransition AutoNextIStateTransition { get; set; }
        void OnEnter();
        void OnExit();
        void Update();
    }
    public abstract class FSMState : IFSMState
    {
        private FSMStateType stateType;
        public List<StateTransition> ConditionTransitions { get; set; }
        public StateTransition AutoNextIStateTransition { get; set; }

        public FSMStateType StateType { get { return stateType; } }


        public void Transition(StateTransition stateTransition)
        {
            if (ConditionTransitions.Contains(stateTransition)) return;
            ConditionTransitions.Add(stateTransition);
        }
        public abstract void OnEnter();
        public abstract void OnExit();
        public abstract void Update();
    }
}